
//
//  YZQBigPictureTableViewCell.m
//  SuperNews
//
//  Created by qiang on 16/1/12.
//  Copyright © 2016年 qiang. All rights reserved.
//

#import "YZQBigPictureTableViewCell.h"

@interface YZQBigPictureTableViewCell ()
@property (nonatomic, retain)NSString *imgsrc;
@property (nonatomic, retain)NSString *title;
@property (nonatomic, retain)NSString *url;


@property (nonatomic, retain)UIImageView *tempImageView;
@property (nonatomic, retain)UILabel *textL;
@property (nonatomic, retain)UIView *blackView;
@end

@implementation YZQBigPictureTableViewCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)setNewsM:(NewsPageModel *)newsM
{
    _newsM = newsM;
    [self getData];
    [self createViews];
}

#pragma mark- 处理数据
- (void)getData
{
    self.imgsrc = [self.newsM imgsrc];
    self.title = [self.newsM title];
    
}

- (void)createViews{
    
    self.tempImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 200)];
    
    self.blackView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 200)];
    self.blackView.backgroundColor = [UIColor blackColor];
    self.blackView.alpha = 0.3;
    [self.tempImageView addSubview:self.blackView];
    
    // 文字Label
    self.textL = [[UILabel alloc]initWithFrame:CGRectMake(10, 180 - 5, [UIScreen mainScreen].bounds.size.width - 100, 20)];
    self.textL.text = self.title;
    self.textL.textColor = [UIColor whiteColor];
    self.textL.font = [UIFont systemFontOfSize:15];
    [self.tempImageView addSubview:self.textL];
    
    NSURL *url = [NSURL URLWithString:self.imgsrc];
    [self.tempImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"placeHoderImage.jpg"]];
    
    [self.contentView addSubview:self.tempImageView];
}


@end
